import { http } from '@/utils/http'

let FixApi = ''
if (process.env.NODE_ENV == 'development') {
  FixApi = '/web' //开发环境
} else {
  FixApi = '/web' //生产环境
}

/**
 * 小程序-巡店任务
 */
export const getTaskList = (data : any) => {
  return http({
    method: 'POST',
    url: `${FixApi}/cl/modelTask/queryClModelTaskPage.json`,
    data,
  })
}
/**
 * 获取任务详情
 */
export const getTaskDetail = (data : any) => {
  return http({
    method: 'POST',
    url: `${FixApi}/cl/modelTask/getClModelTask.json`,
    data,
  })
}

/**
 * 小程序-巡店任务
 */
export const getStoreList = (data : any) => {
  return http({
    method: 'POST',
    url: `${FixApi}/um/huidaUserStore/queryStore.json`,
    data,
  })
}


/**
 * 执行任务
 */
export const excuteTask = (data : any) => {
  return http({
    method: 'POST',
    url: `${FixApi}/cl/modelTask/updateClModelTaskExecute.json`,
    data
  })

}
/**
 * 整改
 */
export const recityTask = (data : any) => {
  return http({
    method: 'POST',
    url: `${FixApi}/cl/modelTask/updateClModelTaskRectify.json`,
    data
  })
}


/**
 *查询门店下的任务明细
 */
export const queryClModelTaskMap = (data : any) => {
  return http({
    method: 'POST',
    url: `${FixApi}/cl/modelTask/queryClModelTaskMap.json`,
    data
  })
}

/**
 *  点检项 结果 审核 更新数据
 */
export const updateModelTaskPatrol = (data : any) => {
  return http({
    url: `${FixApi}/cl/modelTask/updateClModelTaskCheck.json`,
    method: 'POST',
    data
  })
}
/**
 * 分派任务
 */
export const saveClModelTaskByModel = (data : any) => {
  return http({
    url: `${FixApi}/cl/modelTask/saveClModelTaskByModel.json`,
    method: 'POST',
    data
  })
}
/**
 * 获取门店下模版列表
 */
export const queryClModelReDomainByShop = (data : any) => {
  return http({ url: `${FixApi}/cl/model/queryClModelReDomainByShop.json`, method: 'POST', data })
}
/**
 * 提交巡店总结
 */
export const updateClModelTaskSelective = (data : any) => {
  return http({
    url: `${FixApi}/cl/modelTask/updateClModelTaskSelective.json`,
    method: 'POST',
    data
  })
}
